#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);
    ~MusicSlider();
    void setStep(float ratio);

signals:
    void setMusicSliderPosition(float ration);//进度条改变发送音乐播放位置需要改变的信号

protected:

     void mouseMoveEvent(QMouseEvent *event);
     void mousePressEvent(QMouseEvent *event);
     void mouseReleaseEvent(QMouseEvent *event);
     void moveSilde();
private:
    Ui::MusicSlider *ui;
    int currentPos;//当前播放进度
    int maxWidth;//总进度
};

#endif // MUSICSLIDER_H
